import request from "../../request";
import { type R, type DeepRequired } from "../../interface";
import { type AxiosRequestConfig } from "axios";

/**
 * 根据用户名返回用户和token
 * /users/userinfo
 */
export function postUsersUserinfo(params: PostUsersUserinfoParams, config?: AxiosRequestConfig) {
    const paramsInput = {
        username: params.username,
    };
    return request.post<DeepRequired<R>>(`/users/userinfo`, null, {
        params: paramsInput,
        ...config,
    });
}

export interface PostUsersUserinfoParams {
    username: string;
}
